package com.wiscamp.ninechapters.tags.infrastructure.po;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 标签视图
 */
@Entity
@Table(name = "tags_view")
@Data
public class TagView implements PersistenceObject {
    /**
     * 标签编号
     */
    @Id
    @Column(name = "tag_id", nullable = false)
    private long tagId;

    /**
     * 应用编号
     */
    @Column(name = "application_id", nullable = false)
    private long applicationId;

    /**
     * 标签组名称
     */
    @Column(name = "group_name", nullable = false)
    private String groupName = "";

    /**
     * 标签代码
     */
    @Column(name = "tag_code", nullable = false)
    private String tagCode;

    /**
     * 标签名称
     */
    @Column(name = "tag_name", nullable = false)
    private String tagName;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 是否可用
     */
    @Column(name = "is_active", nullable = false)
    private boolean enabled;

    /**
     * 是否删除
     */
    @Column(name = "is_deleted", nullable = false)
    private boolean deleted;

    /**
     * 创建用户
     */
    @Column(name = "created_by", nullable = false, updatable = false)
    private long creatorId;

    /**
     * 创建时间
     */
    @Column(name = "created_time", nullable = false, updatable = false)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    @Column(name = "modified_by")
    private long modifierId;

    /**
     * 编辑时间
     */
    @Column(name = "modified_time")
    private LocalDateTime modificationTime;

    @Column(name = "creator_name")
    private String creatorName = "";

    @Column(name = "modifier_name")
    private String modifierName = "";
}